package com.everwin.web.enums;

public enum YesOrNo {
    /** 是 */
    YES(1,"是"),
    /** 否 */
    NO(0,"否");

    private Integer code;
    private String desc;

    YesOrNo(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByCode(int code){
        if(code==YES.getCode()){
            return YES.getDesc();
        }else if(code==NO.getCode()){
            return NO.getDesc();
        }
        return null;
    }
}
